package com.bmslz.monitor.base.task;

import com.bmslz.monitor.service.IProjectService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @ClassName：OnlineJob
 * @Author: RuYuan Yang
 * @Date: 2025/9/6 14:36
 * @Description: 判断项目是否在线
 */
@Slf4j
@Component
public class OnlineJob {
    @Autowired
    private IProjectService projectService;

    /**
     * @return void
     * @description: 轮训定时任务 将离线的项目改为离线状态 1分钟执行一次
     * @author: RuYuan Yang
     * @date 2025-09-06 14:47:39
     */
    @Scheduled(cron = "0 */1 * * * ?")
    public void executeTask() {
        projectService.refreshOffline();
    }

}
